<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml" xmlns:shiro="http://www.w3.org/1999/xhtml" >
<head>
	<meta charset="UTF-8">
	<title>班车订单管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="Access-Control-Allow-Origin" content="*">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<!--<link rel="icon" href="/favicon.ico">-->
	<link rel="stylesheet" href="/css/public.css" media="all" />
	<div th:include="/common/layui"></div>
	<style type="text/css">
		#diverFrm .layui-form-item .layui-input-inline{
			width:300px;
		}
		#showOrderDiv .layui-form-item {
			margin-bottom: 0px;
		}
		#showOrderDiv .layui-form-label {
			width: 132px;

		}


		#addOrUpdateDiv .layui-form-label {
			width: 132px;

		}
		#showOrderDiv .layui-input-inline {
			width: 230px;
		}
	</style>
</head>
<body class="childrenBody" shiro:hasPermission="order:view">
<!-- 查询条件开始 -->
<!--<fieldset class="layui-elem-field layui-field-title" style="margin-top: 5px;">
	<legend>查询条件</legend>
</fieldset>-->
<blockquote class="layui-elem-quote">
	<form action="" method="post" id="searchFrm" lay-filter="searchFrm" class="layui-form layui-form-pane">
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">订单状态</label>
				<div class="layui-input-inline">
					<select name="order_status" lay-verify="order_status">
						<option value="">All</option>
						<!--转换成英文 orderStatusCodeList.name      汉字 orderStatusCodeList.details-->
						<option th:each="orderStatusCodeList : ${session.orderStatusCodeList}" th:value="${orderStatusCodeList.code}">[[${orderStatusCodeList.code+' '+orderStatusCodeList.details}]]</option>
						<!--<option value="0">0 新增-未发布</option>
						<option value="1">1 已提交-待审核</option>
						<option value="2">2 待补充</option>
						<option value="3">3 被驳回</option>
						<option value="4">4 竞拍中</option>
						<option value="5">5 流拍</option>
						<option value="6">6 待支付</option>
						<option value="7">7 支付成功</option>
						<option value="8">8 服务中</option>
						<option value="9">9 服务完成</option>-->
					</select>
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">发布人</label>
				<div class="layui-input-inline">
					<input type="text" name="contact_name_keys"    autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="width: 144px;">订单新增时间范围</label>
				<div class="layui-input-inline" style="width: 290px;">
					<input type="tel" name="add_time_select" id="add_time_select" readonly="readonly" placeholder="请选择订单新增时间范围" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<button type="button" class="layui-btn" lay-submit="" lay-filter="doSearch"><span class="layui-icon layui-icon-search"></span>查询</button>
				<button type="reset" class="layui-btn layui-btn-warm"><span class="layui-icon layui-icon-refresh-1"></span>重置</button>
			</div>
			<!--<div class="layui-inline">
				<label class="layui-form-label">结束时间</label>
				<div class="layui-input-inline">
					<input type="tel" name="endTime"  id="endTime"  readonly="readonly" placeholder="yyyy-MM-dd HH:mm:ss" class="layui-input">
				</div>
			</div>-->
		</div>

		<!--<div class="layui-form-item">
			<div class="layui-input-block" style="text-align: center;">

			</div>
		</div>-->
	</form>
</blockquote>
<!-- 查询条件结束-->


<!-- 数据表格开始 -->
<div id="guestOrder">
	<table class="layui-hide" id="guestOrderTable" lay-filter="guestOrderTable"></table>
	<div id="noticeToolBar" style="display: none;">
		<button type="button" lay-event="add" class="layui-btn layui-btn-sm" shiro:hasPermission="order:add"><span class="layui-icon layui-icon-add-1"></span>添加班车订单</button>
		<button type="button" lay-event="batchDelete" class="layui-btn layui-btn-sm layui-btn-danger" shiro:hasPermission="order:batchdelete"><span class="layui-icon layui-icon-delete"></span>批量删除</button>
	</div>

	<div id="noticeRowBar" style="display: none;">
		<button type="button" lay-event="update" class="layui-btn layui-btn-sm" shiro:hasPermission="order:update"><span class="layui-icon layui-icon-edit"></span>修改</button>
		<button type="button" lay-event="showOrder" class="layui-btn layui-btn-sm" shiro:hasPermission="order:view"><span class="layui-icon layui-icon-about"></span>查看</button>
		<button type="button" lay-event="delete" class="layui-btn layui-btn-sm layui-btn-danger" shiro:hasPermission="order:delete"><span class="layui-icon layui-icon-delete"></span>删除</button>
	</div>
</div>
<!-- 数据表格结束 -->


<!-- 竞拍参与人列表弹出层开始 -->
<div style="display: none;padding: 5px" id="auctionListPage">
    <table class="layui-hide" id="auctionListTable" lay-filter="auctionListTable"></table>

    <div id="auctionListRowBar" style="display: none;">
        <button type="button" lay-event="selectThisAution" class="layui-btn layui-btn-sm"><span class="layui-icon layui-icon-circle"></span>选中</button>
    </div>
</div>
<!-- 竞拍参与人列表弹出层结束 -->

<!-- 服务人员信息弹出层开始 -->
<div style="display: none;padding: 5px" id="showDiverPage">
	<form action="" method="post" class="layui-form layui-form-pane" id="diverFrm" lay-filter="diverFrm">

		<div class="layui-form-item">

			<div class="layui-inline">
				<label class="layui-form-label">服务人姓名</label>
				<div class="layui-input-inline">
					<input type="hidden" name="user_id">
					<input type="hidden" name="driver_id">
					<input type="hidden" name="carrier_id">
					<input type="text" name="avatar" lay-verify="required" autocomplete="off" placeholder="请输入服务人姓名" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">服务人电话</label>
				<div class="layui-input-inline">
					<input type="text" name="phone" lay-verify="required" autocomplete="off" placeholder="请输入服务人联系电话" class="layui-input">
				</div>
			</div>

		</div>



		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">分类</label>
				<div class="layui-input-inline">
					<select name="role_id" lay-filter="" disabled="disabled">
						<option value="4">司机</option>
						<option value="3">承运商</option>
					</select>
				</div>
			</div>
			<div class="layui-inline">
				<button type="button" class="layui-btn layui-btn-normal"><span class="layui-icon layui-icon-search"></span> 搜索选择</button>
			</div>

		</div>

		<!--司机信息-->
		<div class="dirver-info" style="display: none">
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">驾照号</label>
					<div class="layui-input-inline">
						<input type="text" name="driver_lic" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">驾照过期日</label>
					<div class="layui-input-inline">
						<input type="text" name="driver_lic_expired" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>

			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">车牌号</label>
					<div class="layui-input-inline">
						<input type="text" name="car_plate" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">保险过期日</label>
					<div class="layui-input-inline">
						<input type="text" name="insur_expired" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>

			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">车品牌</label>
					<div class="layui-input-inline">
						<input type="text" name="car_brand" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">座位数量</label>
					<div class="layui-input-inline">
						<input type="text" name="car_seat" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
			</div>


			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">归属承运商</label>
					<div class="layui-input-inline">
						<input type="text" name="carrier_name" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">信用积分</label>
					<div class="layui-input-inline">
						<input type="text" name="server_credit_earned" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
			</div>
		</div>

		<!--承运商信息-->
		<div class="carrier-info" style="display: none">

			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">承运商名称</label>
					<div class="layui-input-inline">
						<input type="text" name="carrier_name" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">营业执照</label>
					<div class="layui-input-inline">
						<input type="text" name="carrier_lic" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">执照过期日</label>
					<div class="layui-input-inline">
						<input type="text" name="carrier_lic_expired" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">信用积分</label>
					<div class="layui-input-inline">
						<input type="text" name="server_credit_earned" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
					</div>
				</div>
			</div>
		</div>


		<!--<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">信用积分</label>
				<div class="layui-input-inline">
					<input type="text" name="server_credit_earned" lay-verify="required" autocomplete="off" placeholder="请点击搜索选择" disabled="disabled" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">

			</div>
		</div>-->

		<div class="layui-form-item">
			<div class="layui-input-block" style="text-align: center;margin: 30px 0 0 0;">
				<button type="button" class="layui-btn" lay-submit="" id="doSubmit2" ><span class="layui-icon layui-icon-add-1"></span>确认</button>
				<button type="reset" class="layui-btn layui-btn-warm"><span class="layui-icon layui-icon-refresh-1"></span>重置</button>
				<button type="button" class="layui-btn layui-btn-normal"><span class="layui-icon layui-icon-close"></span>取消</button>
			</div>
		</div>
	</form>
</div>
<!-- 服务人员信息弹出层结束 -->



<!-- 添加和修改的弹出层开始 -->
<div style="display: none;padding: 5px" id="addOrUpdateDiv">
	<form action="" method="post" class="layui-form layui-form-pane" id="dataFrm" lay-filter="dataFrm">

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">shuttleName</label>
				<div class="layui-input-inline">
					<input type="text" name="shuttle_name" lay-verify="required" placeholder="输入班车名称" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">TimeDepart</label>
				<div class="layui-input-inline">
					<input type="tel" name="time_depart" lay-verify="required" id="time_depart_select" readonly="readonly" placeholder="请选择出发时间" class="layui-input">
				</div>
			</div>

		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">FromWhere</label>
				<div class="layui-input-inline">
					<input type="text" name="fromwhere"  lay-verify="required"  autocomplete="off" placeholder="出发地" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">ToWhere</label>
				<div class="layui-input-inline">
					<input type="text" name="towhere"  lay-verify="required"  autocomplete="off" placeholder="目的地" class="layui-input">
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">Stop1</label>
				<div class="layui-input-inline">
					<input type="text" name="stop1"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">Stop2</label>
				<div class="layui-input-inline">
					<input type="text" name="stop2"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">Stop3</label>
				<div class="layui-input-inline">
					<input type="text" name="stop3"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">Stop4</label>
				<div class="layui-input-inline">
					<input type="text" name="stop4"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">Stop5</label>
				<div class="layui-input-inline">
					<input type="text" name="stop5"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
				</div>
			</div>

			<div class="layui-inline">
				<label class="layui-form-label">custo_costs</label>
				<div class="layui-input-inline">
					<input type="number" name="custo_costs"  lay-verify="required|number"  autocomplete="off" placeholder="" class="layui-input">
				</div>
			</div>
		</div>


		<div class="layui-form-item" id="addOrUpdateBtn" shiro:hasPermission="order:update">
			<div class="layui-input-block" style="text-align: center;margin-right: 110px;">
				<button type="submit" class="layui-btn" lay-submit="" lay-filter="doSubmit" id="doSubmit" ><span class="layui-icon layui-icon-add-1"></span>提交</button>
				<!--<button type="reset" class="layui-btn layui-btn-warm"><span class="layui-icon layui-icon-refresh-1"></span>重置</button>-->
			</div>
		</div>
	</form>
</div>
<!-- 添加和修改的弹出层结束 -->





<!-- 查看弹出层的开始 -->
<div class="layui-form layui-form-pane" style="display: none;padding: 5px;" id="showOrderDiv">

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">发布人</label>
			<div class="layui-input-inline">
				<input type="text" name="contact_name"  lay-verify=""  autocomplete="off" placeholder="请输入发布人" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">发布时间</label>
			<div class="layui-input-inline">
				<input type="text" name="add_time"  lay-verify=""  autocomplete="off" placeholder="请输入发布时间" class="layui-input">
			</div>
		</div>
	</div>


	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">OrderId</label>
			<div class="layui-input-inline">
				<input type="text" name="order_id"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">OrderStatus</label>
			<div class="layui-input-inline">
				<input type="text" name="order_status_name"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">ContactName</label>
			<div class="layui-input-inline">
				<input type="text" name="contact_phone"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">EmailContact</label>
			<div class="layui-input-inline">
				<input type="text" name="contact_email"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">CustoSum</label>
			<div class="layui-input-inline">
				<input type="text" name="custo_sum"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">DriverPhone</label>
			<div class="layui-input-inline">
				<input type="text" name="driver_phone"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">CarrierName</label>
			<div class="layui-input-inline">
				<input type="text" name=""  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">CarrierPhone</label>
			<div class="layui-input-inline">
				<input type="text" name=""  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">TimeDepart</label>
			<div class="layui-input-inline">
				<input type="text" name="time_depart"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">FromWhere</label>
			<div class="layui-input-inline">
				<input type="text" name="fromwhere"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">OrderVoucher</label>
			<div class="layui-input-inline">
				<input type="text" name="order_voucher"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">ExtraRequest</label>
			<div class="layui-input-inline">
				<input type="text" name="extra_request"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">Stop1</label>
			<div class="layui-input-inline">
				<input type="text" name="stop1"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">Stop2</label>
			<div class="layui-input-inline">
				<input type="text" name="stop2"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">Stop3</label>
			<div class="layui-input-inline">
				<input type="text" name="stop3"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">Stop4</label>
			<div class="layui-input-inline">
				<input type="text" name="stop4"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">Stop5</label>
			<div class="layui-input-inline">
				<input type="text" name="stop5"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">ToWhere</label>
			<div class="layui-input-inline">
				<input type="text" name="towhere"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">TimeReturn</label>
			<div class="layui-input-inline">
				<input type="text" name="time_return"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">EstTimeNeeded</label>
			<div class="layui-input-inline">
				<input type="text" name="est_time_needed"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">VehicleType</label>
			<div class="layui-input-inline">
				<input type="text" name="vehicle_type"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">VehiclePlate</label>
			<div class="layui-input-inline">
				<input type="text" name="vehicle_plate"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">CustoCosts</label>
			<div class="layui-input-inline">
				<input type="text" name="custo_costs"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">FlightId</label>
			<div class="layui-input-inline">
				<input type="text" name="flight_id"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">BigLuggage</label>
			<div class="layui-input-inline">
				<input type="text" name="big_luggage"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">CarryLuggage</label>
			<div class="layui-input-inline">
				<input type="text" name="carry_luggage"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">Babyseats_s</label>
			<div class="layui-input-inline">
				<input type="text" name="babyseats_s"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">Babyseats_b</label>
			<div class="layui-input-inline">
				<input type="text" name="babyseats_b"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">Trailer</label>
			<div class="layui-input-inline">
				<input type="text" name="trailer"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">Toll</label>
			<div class="layui-input-inline">
				<input type="text" name="toll"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">GST</label>
			<div class="layui-input-inline">
				<input type="text" name="GST"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">Driver_DM</label>
			<div class="layui-input-inline">
				<input type="text" name="driver_DM"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">APF</label>
			<div class="layui-input-inline">
				<input type="text" name="APF"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
		<div class="layui-inline">
			<label class="layui-form-label">NPEF</label>
			<div class="layui-input-inline">
				<input type="text" name="NPEF"  lay-verify=""  autocomplete="off" placeholder="" class="layui-input">
			</div>
		</div>
	</div>




	<div id="show_content"></div>

</div>
<!-- 查看弹出层的结束-->


<!--<script type="text/javascript" src="/resources/layui/layui.js"></script>-->
<script type="text/javascript">
	layui.use(['jquery','form','table','layer','laydate','layedit'],function(){
		$=layui.jquery;
		var form=layui.form;
		var table=layui.table;
		var layer=layui.layer;
		var laydate=layui.laydate;
		var layedit=layui.layedit;
		//初始化时间选择器
		laydate.render({
			elem:'#add_time_select',
			type:'datetime',
			range: true
		});
		laydate.render({
			elem:'#time_depart_select',
			type:'datetime',
		});
		laydate.render({
			elem:'#time_return_select',
			type:'datetime',
		});
		/*laydate.render({
			elem:'#endTime',
			type:'datetime'
		});*/

		//初始化富文本
		var editIndex = layedit.build('content');
		//加载 数据
		tableIns=table.render({
			elem: '#guestOrderTable'
			,url:'/admin/shuttleBusOrder/list'
			,method:'post'//接口http请求类型，默认：get
			,toolbar: '#noticeToolBar' //开启头部工具栏，并为其绑定左侧模板
			,title: '订单数据表'
			,height:'full-220'
			,page: true
			,loading:true//是否显示加载条（默认：true）。如果设置 false，则在切换分页时，不会出现加载条。该参数只适用于 url 参数开启的方式
			,cols: [ [
				{type: 'checkbox', fixed: 'left'}
				,{field:'order_id', title:'ID',align:'center',width:'60'}
				,{field:'contact_name', title:'发布人',align:'center',minWidth:'87'}
				,{field:'insert_time', title:'订单操作时间',align:'center',minWidth:'168'}

				,{field:'shuttle_name', title:'班车线路名称',align:'center',minWidth:'122'}

				,{field:'time_depart', title:'班车发出时间',align:'center',minWidth:'168'}
				/*订单审核*/
				,{field:'order_status_name', title:'订单状态',align:'center',minWidth:'125',}
				/*,{field:'', title:'状态名称',align:'center',minWidth:'125',templet:function(d){
					let order_status_str='';
					switch (d.order_status) {
						case 0:
							order_status_str = '新增-未发布';
							break;
						case 1:
							order_status_str = '已提交-待审核';
							break;
						case 2:
							order_status_str = '待补充';
							break;
						case 3:
							order_status_str = '被驳回';
							break;
						case 4:
							order_status_str = '竞拍中';
							break;
						case 5:
							order_status_str = '流拍';
							break;
						case 6:
							order_status_str = '待支付';
							break;
						case 7:
							order_status_str = '支付成功';
							break;
						case 8:
							order_status_str = '服务中';
							break;
						case 9:
							order_status_str = '服务完成';
							break;

					}
					return order_status_str;
				}}*/
				,{field:'', title:'审批操作',align:'center',minWidth:'283',templet:function(d){
					let order_status_btn='';
					switch (d.order_status) {
						case 0:
							/*lay-event="changgeOrderStatus"*/
							order_status_btn = '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="changgeOrderStatus1" >发布订单</button>';
							break;
						case 1:
							order_status_btn = '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="changgeOrderStatus6">内部消化</button> ' +
									'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="changgeOrderStatus4">发布竞拍</button> ' +
									'<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="changgeOrderStatus2">补充信息</button> ' +
									'<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="changgeOrderStatus3">驳回</button>';
							break;
						case 2:
							order_status_btn = '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="changgeOrderStatus1">发布订单</button> ' +
									'<button class="layui-btn layui-btn-normal layui-btn-xs">发送邮件通知游客</button>';
							break;
						case 3:
							order_status_btn = '';
							break;
						case 4:
							order_status_btn = '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="showAuctionInfo">查看竞拍情况</button>';
							break;
						case 5:
							order_status_btn = '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="changgeOrderStatus1">发布订单</button> ' +
									'<button class="layui-btn layui-btn-normal layui-btn-xs">发送邮件通知游客</button>';
							break;
						case 6:
							order_status_btn = '<button class="layui-btn layui-btn-normal layui-btn-xs">发送邮件通知游客支付</button>';
							break;
						case 7:
							order_status_btn = '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="confirmDriverInfo">确定司机信息</button> <a class="layui-btn layui-btn-normal layui-btn-xs">发送邮件</button>';
							break;
						case 8:
							order_status_btn = '';
							break;
						case 9:
							order_status_btn = '';
							break;

					}
					return order_status_btn;
				}}
				,{field:'custo_costs', title:'支付金额',align:'center',minWidth:'87'}
				,{field:'passengers', title:'游客人数',align:'center',minWidth:'87'}
				,{field:'fromwhere', title:'出发地址',align:'center',minWidth:'87'}
				,{field:'towhere', title:'出发地址',align:'center',minWidth:'87'}
				,{field:'stop1', title:'stop1',align:'center',minWidth:'87'}
				,{field:'stop2', title:'stop2',align:'center',minWidth:'87'}
				,{field:'stop3', title:'stop3',align:'center',minWidth:'87'}
				,{field:'stop4', title:'stop4',align:'center',minWidth:'87'}
				,{field:'stop5', title:'stop5',align:'center',minWidth:'87'}

				,{field:'pay_type', title:'支付类型',align:'center',minWidth:'87'}

				,{fixed: 'right', title:'操作', toolbar: '#noticeRowBar',align:'center',minWidth:'260'}
			] ]
		});

		//模糊查询
		form.on("submit(doSearch)",function(data){
			tableIns.reload({
				where:data.field,
				page:{
					curr:1
				}
			});
			return false;
		});

		//监听工具条的事件
		table.on("toolbar(guestOrderTable)",function(obj){
			switch(obj.event){
				case 'batchDelete':
					batchDelete();
					break;
				case 'add':
					openAddLayer();
					break;
			};
		});

		//监听行工具条的事件
		table.on("tool(guestOrderTable)",function(obj){
			var data = obj.data; //获得当前行数据
			let ajax_data = {};
			switch(obj.event){
				case 'update':
					openUpdateLayer(data);
					break;
				case 'delete':
					deleteOrder(data);
					break;
				case 'showOrder':
					showOrder(data);
					break;
				case 'changgeOrderStatus1':
					console.log("发布订单");
					ajax_data = {
						"order_id":data.order_id,
						"order_status":1
					};
					changgeOrderStatus(ajax_data);
					break;
				case 'changgeOrderStatus2':
					console.log("补充信息");
					layer.prompt({title: '请输入游客需补充的信息', formType: 2}, function(text, index){
						layer.close(index);
						email_msg = text;
						//询问框
						layer.confirm('游客需补充的信息为：<br><div style="color: #FF5722">'+ email_msg+'</div><br>是否发送邮件通知游客?', {
							btn: ['发送','取消'] //按钮
						}, function(){
							// layer.msg('提交成功');
							ajax_data = {
								"order_id":data.order_id,
								"order_status":2,
								"email_msg":email_msg
							};
							changgeOrderStatus(ajax_data);
						});
					});
					break;
				case 'changgeOrderStatus3':
					console.log("驳回");
					layer.prompt({title: '请输入驳回该订单的理由:', formType: 2}, function(text, index){
						layer.close(index);
						email_msg = text;
						//询问框
						layer.confirm('驳回该订单的理由为：<br><div style="color: #FF5722">'+ email_msg+'</div><br>是否发送邮件通知游客?', {
							btn: ['发送','取消'] //按钮
						}, function(){
							// layer.msg('提交成功');
							ajax_data = {
								"order_id":data.order_id,
								"order_status":3,
								"email_msg":email_msg
							};
							changgeOrderStatus(ajax_data);
						});
					});
					break;
				case 'changgeOrderStatus4':

					layer.prompt({title: '请输入竞拍时间范围(单位：小时)', formType: 0}, function(text, index){
						layer.close(index);
						auction_range_time = text;
						//询问框
						layer.confirm('您输入竞拍时间范围为：<br><br><div style="color: #FF5722">'+ auction_range_time+' (暂时单位为分钟-便于测试)</div><br>是否确认提交?', {
							btn: ['提交','取消'] //按钮
						}, function(){
							// layer.msg('提交成功');
							ajax_data = {
								"order_id":data.order_id,
								"order_status":4,
								"auction_range_time":auction_range_time
							};
							console.log(ajax_data);
							changgeOrderStatus(ajax_data);

						});
					});
					break;
				case 'changgeOrderStatus6':
					console.log("内部消化-待支付");
					//prompt层
					let custo_costs;
					layer.prompt({title: '请输入游客需支付金额', formType: 0}, function(text, index){
						layer.close(index);
						custo_costs = text;
						//询问框
						layer.confirm('您输入的支付金额为：<br><br><div style="color: #FF5722">'+ custo_costs+'</div><br>是否确认提交?', {
							btn: ['提交','取消'] //按钮
						}, function(){
							// layer.msg('提交成功');
							ajax_data = {
								"order_id":data.order_id,
								"order_status":6,
								"custo_costs":custo_costs
							};
							changgeOrderStatus(ajax_data);

						});
					});
					break;

				case 'showAuctionInfo':
					//显示该订单的竞拍信息
					console.log("显示该订单的竞拍信息");
					console.log("order_id:"+data.order_id);
					$.post("/admin/order/showAuctionInfo",{order_id:data.order_id},function(res){
						if(res.code==200){
							if(res.auctionList.length > 0){
								openLayerAuctionListPage(res.auctionList);
							}else{
								layer.msg("暂无人参与该订单竞拍!");
							}
						}else{
                            layer.msg(res.msg);
                        }
					})
					break;
				case 'confirmDriverInfo':
					//弹出层 确认司机信息
					console.log("确认司机信息");
					console.log("order_id:"+data.order_id);
					$.post("/admin/order/showDiverInfo",{order_id:data.order_id},function(res){
						if(res.code==200){
							openLayerShowDiverPage(res.servicePersonal);//弹出层显示司机信息页面
						}else{
                            layer.msg(res.msg);
                        }
					})
					break;
			};
		});

        //监听行工具条的事件
        table.on("tool(auctionListTable)",function(obj){
            switch(obj.event){
                case 'selectThisAution':
                    console.log("selectThisAution")
                    // openUpdateNoticeLayer(data);
                    break;
            };
        });


		var mainIndex;
		var url;
		//打开添加的弹出层
		function openAddLayer(){
			mainIndex=layer.open({
				type:1,
				content:$("#addOrUpdateDiv"),
				area:['800px','600px'],
				title:'新增班车订单',
				success:function(){
					$("#dataFrm")[0].reset();
					layedit.setContent(editIndex,"");
					url="/admin/shuttleBusOrder/add";
				}
			});
		}

		//打开修改的弹出层
		function openUpdateLayer(data){
			let cHight = document.body.clientHeight - 50 + "px";
			// console.log("cHight = " + cHight);
			mainIndex=layer.open({
				type:1,
				content:$("#addOrUpdateDiv"),
				area:['800px',cHight],
				title:'修改订单',
				success:function(){
					// console.log("data.content="+data.content)
					$("#addOrUpdateBtn").show();
					$("#dataFrm")[0].reset();
					//装载新的数据
					form.val("dataFrm",data);
					// layedit.setContent(editIndex,data.content);// 富文本
					url="/admin/order/update";
				}
			});
		}
		//打开竞拍参与人列表弹出层
		function openLayerAuctionListPage(auctionList){

			cuctionListPage=layer.open({
				type:1,
				content:$("#auctionListPage"),
				area:['900px','610px'],
				title:'竞拍参与人列表',
				success:function(){

					var cuctionTableIns=table.render({
						elem: '#auctionListPage'
						,data:auctionList
						// ,url:'/admin/order/loadAllGuestOrder'
						// ,method:'post'//接口http请求类型，默认：get
						// ,toolbar: '#noticeToolBar' //开启头部工具栏，并为其绑定左侧模板
						,title: '参与订单竞拍的数据表'
						,height:'full-220'
						,page: {limit: 50}
						,loading:true//是否显示加载条（默认：true）。如果设置 false，则在切换分页时，不会出现加载条。该参数只适用于 url 参数开启的方式
						,cols: [ [
							// {type: 'checkbox', fixed: 'left'},
							{field:'auction_id', title:'ID',align:'center',width:'60'}
							,{field:'order_id', title:'订单ID',align:'center',minWidth:'87'}
							,{field:'server_user_name', title:'竞拍人',align:'center',minWidth:'87'}
							,{field:'auction_amount', title:'竞拍金额',align:'center',minWidth:'103',sort:true}
							,{field:'server_driver_phone', title:'竞拍人电话',align:'center',minWidth:'122'}
							,{field:'auction_add_time', title:'参与时间',align:'center',minWidth:'166'}
							,{field:'auction_update_time', title:'更新时间',align:'center',minWidth:'166'}
							// ,{fixed: 'right', title:'操作', toolbar: '#auctionListRowBar',align:'center',minWidth:'97'}
							,{fixed: 'right', title:'操作',align:'center',minWidth:'97', templet:function(d){
							    let btn = '<button type="button" class="layui-btn layui-btn-sm" onclick=selectThisAution("'+d.auction_id+'","'+d.order_id+'","'+d.auction_amount+'","'+d.server_user_name+'","'+d.server_driver_phone+'")>' +
                                    '<span class="layui-icon layui-icon-circle"></span>选中' +
                                    '</button>';
							    return btn;
                                }
						    }
						] ]
					});

				},
				cancel: function(index, layero){
					layer.close(index);
					$("[lay-id='auctionListPage']").remove();
					return false;
				}
			});
		}
		//打开服务人员确认信息弹出层
		function openLayerShowDiverPage(data){
			$(".carrier-info").hide();
			$(".dirver-info").hide();

			let showDiverPage=layer.open({
				type:1,
				content:$("#showDiverPage"),
				area:['900px','610px'],
				title:'服务人员信息确认表',
				success:function(){
					if(data){
						let role_id=data.servicePersonal.role_id;
						console.log(role_id)
						if(role_id == 3){
							$(".carrier-info").show();
						}
						if(role_id == 4){
							$(".dirver-info").show();
						}
						backfillData(data.servicePersonal);
						backfillData(data.servicePersonal.driver);
						backfillData(data.servicePersonal.carrier);
					}


					form.render();
				},
				cancel: function(index, layero){
					layer.close(index);
					$("[lay-id='showDiverPage']").remove();
					return false;
				}
			});
		}


		// $("#doSubmit").click(function(){
			//同步富文本和textarea里面的内容
			// layedit.sync(editIndex);
			form.on('submit(doSubmit)', function(data){
				var data=$("#dataFrm").serialize();
				// console.log(data);
				$.post(url,data,function(res){
					if(res.code==200){
						tableIns.reload();
					}
					layer.msg(res.msg);
					layer.close(mainIndex);
				})
			});




		// })
		//删除
		function deleteOrder(data){
			layer.confirm('你确定要删除【'+data.contact_name+'】这条订单吗?', {icon: 3, title:'提示'}, function(index){
				$.post("/admin/order/deleteGuestOrder",{order_id:data.order_id},function(res){
					if(res.code==200){
						tableIns.reload();
					}
					layer.msg(res.msg);
				})
				layer.close(index);
			});
		}

		//批量删除
		function  batchDelete(){
			//得到选中行
			var checkStatus = table.checkStatus('guestOrderTable');
			var dataLength=checkStatus.data.length;
			if(dataLength>0){
				layer.confirm('你确定要删除这些订单数据吗?', {icon: 3, title:'提示'}, function(index){
					var data=checkStatus.data; //获取选中行的数据
					var ids="";
					$.each(data,function(index,item){
						if(index==0){
							ids+="ids="+item.order_id;
						}else{
							ids+="&ids="+item.order_id;
						}
					})
					$.post("/admin/order/batchDeleteGuestOrder",ids,function(res){
						if(res.code==200){
							tableIns.reload();
						}
						layer.msg(res.msg);
					})
					layer.close(index);
				});

			}else{
				layer.msg("请选中操作行")
			}
		}

		//弹出查看层
		function showOrder(data){
			let cHight = document.body.clientHeight - 50 + "px";

			console.log("cHight="+cHight);

			mainIndex=layer.open({
				type:1,
				content:$("#addOrUpdateDiv"),
				area:['800px',cHight],
				title:'查看订单',
				success:function(){
					// $("#show_title").html(data.title);
					// $("#show_opername").html(data.opername);
					// $("#show_createtime").html(data.createtime);
					// $("#show_content").html(data.content);

					// showOrderInfo(data);


					$("#dataFrm")[0].reset();
					//装载新的数据
					form.val("dataFrm",data);
					$("#addOrUpdateBtn").hide();
				}
			});
		}


		//弹出查看层
		function showOrderInfo(data){
			console.log("showOrderInfo  data.order_id="+data.order_id);

			backfillData(data);

		}




		//修改订单状态
		function changgeOrderStatus(data) {
			// console.log("order_id:"+order_id);
			// console.log("order_status:"+order_status);
			let url = "/admin/order/updateOrder";
			$.post(url,data,function(res){
				if(res.code==200){
					tableIns.reload();
                    layer.msg(res.msg);
                }else{
                    layer.closeAll();
                    layer.msg(res.msg);
                }
			})
			tableIns.reload();
		}

	});

    function selectThisAution(auction_id,order_id,auction_amount,server_user_name,server_driver_phone){
        // console.log(auction_id);
        //prompt层
        let custo_costs;
        layer.prompt({title: '请输入游客需支付金额', formType: 0}, function(text, index){
            layer.close(index);
            custo_costs = text;
            //询问框
            let msgStr = '竞拍人：' + '<span style="color: #FF5722">'+ server_user_name+'</span>' +
                '<br>' +
                '竞拍人电话:' + '<span style="color: #FF5722">'+ server_driver_phone+'</span>' +
                '<br>' +
                '竞拍金额:' + '<span style="color: #FF5722">'+ auction_amount+'</span>' +
                '<br>' +
                '游客待支付金额:' +'<span style="color: #FF5722">'+ custo_costs+'</span>' +
                '<br>' +
                '是否确认提交并发送邮件通知?';

            layer.confirm(msgStr, {
                btn: ['提交','取消'] //按钮
            }, function(){
                // layer.msg('提交成功');
                let ajax_data = {
                    "auction_id":auction_id,
                    "order_id":order_id,
                    "custo_costs":custo_costs
                };
                console.log(ajax_data);
                // changgeOrderStatus(ajax_data);
                let url = "/admin/order/confirmAuction";
				$.post(url,ajax_data,function(res){
					if(res.code==200){
						tableIns.reload();
						layer.closeAll();
						layer.msg("提交成功");
					}else{
						layer.closeAll();
						layer.msg(res.msg);
					}
				})

            });
        });
    }


	function backfillData(obj){
		for(var key in obj ){
			if(obj.hasOwnProperty(key)){
				if($(".layui-layer-content input[type='hidden'][name='"+key+"']").length>0){
					$(".layui-layer-content input[type='hidden'][name='"+key+"']").val(obj[key]);
				}
				if($(".layui-layer-content input[type='text'][name='"+key+"']").length>0){
					$(".layui-layer-content input[type='text'][name='"+key+"']").val(obj[key]);
				}
				if($(".layui-layer-content select[name='"+key+"'").length>0){
					$(".layui-layer-content select[name='"+key+"'] option[value='"+obj[key]+"']").attr("selected","selected");
				}
				if($(".layui-layer-content input[type='checkbox'][name='"+key+"']").length>0){
					$(".layui-layer-content input[name='"+key+"'][value='"+obj[key]+"']").attr("checked","checked");
				}
				if($(".layui-layer-content input[type='radio'][name='"+key+"']").length>0){
					$(".layui-layer-content input[name='"+key+"'][value='"+obj[key]+"']").attr("checked","checked");
				}
			}
		}
	}


</script>

</body>
</html>